<?php
/**
 * Created by PhpStorm.
 * User: Dinglf
 * Date: 2016/9/19 0019
 * Time: 22:40
 */
class MysubStr
{
    function csubstr($str,$start,$len)
    {
        $tmpstr = '';
        $strlen = $start + $len;
        for($i = 0; $i < $strlen; $i++)
        {
            if(ord(substr($str,$i,1)) > 0xa0)
            {
                $tmpstr .= substr($str,$i,3);
                $i += 2;
            }
            else
            {
                $tmpstr .= substr($str,$i,1);
            }
        }
        return $tmpstr;
    }
}